package com.property.demo.service;

import com.property.demo.model.Owner;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

public interface OwnerService {
    
    List<Owner> findAll();
    
    Page<Owner> findAll(Pageable pageable);
    
    Optional<Owner> findById(Long id);
    
    Owner save(Owner owner);
    
    Owner update(Long id, Owner ownerDetails);
    
    void delete(Long id);
    
    void deleteAll(List<Long> ids);
    
    List<Owner> findByName(String name);
    
    List<Owner> findByPhoneNumber(String phoneNumber);
    
    List<Owner> findByIdCard(String idCard);
    
    Page<Owner> findByFilters(String name, String phoneNumber, String idCard, Pageable pageable);
    
    /**
     * 根据业主ID获取所属小区名称
     * @param ownerId 业主ID
     * @return 小区名称，如果没有找到则返回null
     */
    String findCommunityNameByOwnerId(Long ownerId);
} 